package user

import (
	"context"
	"git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/dto/base"
	userRepo "git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/repository/base/user"
	"git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/utils/auth"
	microGfyxOpptyService "git.mycaigou.com/gfyx/micro-gfyx-api/proto/micro_gfyx_oppty_service_proto/micro-gfyx-oppty-service/base"
)

type LoginServiceIface interface {
	UnionUserLogin(ctx context.Context, tenantCode, account, password string) (*userRepo.UnionUserLoginInfo, error)
	// LoginByPassword 账号密码登录
	LoginByPassword(ctx context.Context, request base.UsingPasswordRequest) (*base.UsingPasswordResponse, error)
	// LoginByPhone 手机号验证码登录
	LoginByPhone(ctx context.Context, request base.UsingPhoneRequest) (*base.UsingPhoneResponse, error)
	// GetResetPasswordToken 获取重置密码 token
	GetResetPasswordToken(ctx context.Context, request base.GetResetPasswordTokenRequest) (*base.GetResetPasswordTokenResponse, error)
	// ResetPasswordByPhone 通过手机号重设密码
	ResetPasswordByPhone(ctx context.Context, request base.ResetByPhoneRequest) (*base.ResetByPhoneResponse, error)
	// Sso 单点登录
	Sso(ctx context.Context, params *microGfyxOpptyService.SsoRequest) (*base.SsoResponse, error)
	// LoginUser 获取登录用户
	LoginUser(ctx context.Context, token string) (*auth.LoginUserInfo, error)
	// LogoutUser 退出登录
	LogoutUser(ctx context.Context, token string) (bool, error)
	// RefreshToken 刷新 token
	RefreshToken(ctx context.Context, request base.RefreshTokenRequest) (*base.RefreshTokenResponse, error)
	// ClearUserLockCache clear 用户锁定缓存
	ClearUserLockCache(ctx context.Context, request base.ReleaseAccountRequest) error
}
